home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / ASTRNOMY / AA_51.ZIP / DIURAB.C < prev    next >
C/C++ Source or Header  |  1993-02-09  |  967b  |  44 lines

  1. /* Diurnal aberration
  2.  * This formula is less rigorous than the method used for
  3.  * annual aberration.  However, the correction is small.
  4.  */
  5.  
  6. #include "kep.h"
  7.  
  8. /* distance from observer to center of Earth, in Earth radii: */
  9. extern double trho;
  10.  
  11. /* geocentric latitude of observer, degrees: */
  12. extern double tlat;
  13.  
  14. int diurab( last, ra, dec )
  15. double last;    /* local apparent sidereal time, radians */
  16. double *ra;    /* right ascension, radians */
  17. double *dec;    /* declination, radians */
  18. {
  19. double lha, coslha, sinlha, cosdec, sindec;
  20. double coslat, N, D;
  21.  
  22. lha = last - *ra;
  23. coslha = cos(lha);
  24. sinlha = sin(lha);
  25. cosdec = cos(*dec);
  26. sindec = sin(*dec);
  27. coslat = cos( DTR*tlat );
  28.  
  29. if( cosdec != 0.0 )
  30.     N = 1.5472e-6*trho*coslat*coslha/cosdec;
  31. else
  32.     N = 0.0;
  33. *ra += N;
  34.  
  35. D = 1.5472e-6*trho*coslat*sinlha*sindec;
  36. *dec += D;
  37.  
  38. if( prtflg )
  39.     {
  40. printf( "diurnal aberration dRA %.3lfs dDec %.2lf\"\n", RTS*N/15.0, RTS*D );
  41.     }
  42. return(0);
  43. }
  44.